import { useRequest, defaultFormatResult } from '@/hooks';
import { checkNeedSendMail } from '@/pages/Recruitment/service';

const useNeedSendMail = ({ arrangeId, resumeId }) => {
    const extraParam = arrangeId ? { arrangeId } : {};
    const { data } = useRequest(() => checkNeedSendMail({ resumeId, ...extraParam }), {
        ...defaultFormatResult,
        initialData: false,
        ready: !!resumeId,
        refreshDeps: [arrangeId, resumeId]
    });
    return data;
};

export default useNeedSendMail;
